<template>
  <e-table
    ref="eTable"
    :tableData="tableData"
    :columns="columns"
    :loading="loading"
    :pageObj="null"
    :border="null"
    :maxHeight="400"
    @row-click="handleRowClick"
  />
</template>

<script>
import { getPatrolList } from '@/api/monitor'
import { getMonitorTime } from '@/utils/util'

export default {
  data() {
    return {
      tableData: [],
      columns: [
        {
          label: '科室',
          prop: 'deptName'
        },
        {
          label: '应查',
          prop: 'targetNum'
        },
        {
          label: '已查',
          prop: 'taskNum'
        },
        {
          label: '完成率',
          prop: 'finRate'
        }
      ],
      loading: false
    }
  },
  async created() {
    let param = getMonitorTime()
    const res = await getPatrolList(param)
    console.log('getPatrolList res', res)
    this.tableData = res.data
  },
  methods: {
    handleRowClick(row, column, event) {
      this.$router.push({
        path: '/monitor/monitor-transDetail',
        query: { row: JSON.stringify(row) }
      })
    }
  }
}
</script>
